import { useHash } from 'react-use';
import React from 'react';

const Demo = () => {
  const [hash, setHash] = useHash();

  // 可以通过useHash进行路由跳转
  function dianji(){
    setHash('#/braft-editor');
  }

  return (
    <div>
      <button type="button" onClick={dianji}>点击</button>
      <div>window.location.href:</div>
      <div>
        <pre>{window.location.href}</pre>
      </div>
      <div>Edit hash: </div>
      <div>
        <input style={{ width: '100%' }} value={hash} onChange={e => setHash(e.target.value)} />
      </div>
    </div>
    
  );
};

export default Demo;